package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcClassStudent;
import com.visizen.wisdomclass.server.model.WcClassStudentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcClassStudentMapper {
    @SelectProvider(type=WcClassStudentSqlProvider.class, method="countByExample")
    int countByExample(WcClassStudentExample example);

    @DeleteProvider(type=WcClassStudentSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcClassStudentExample example);

    @Delete({
        "delete from wc_class_student",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_class_student (ID, STUDENT_ID, ",
        "CLASS_ID, C_DATE)",
        "values (#{ID,jdbcType=BIGINT}, #{STUDENT_ID,jdbcType=BIGINT}, ",
        "#{CLASS_ID,jdbcType=BIGINT}, #{c_DATE,jdbcType=TIMESTAMP})"
    })
    int insert(WcClassStudent record);

    @InsertProvider(type=WcClassStudentSqlProvider.class, method="insertSelective")
    int insertSelective(WcClassStudent record);

    @SelectProvider(type=WcClassStudentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="STUDENT_ID", property="STUDENT_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="C_DATE", property="c_DATE", jdbcType=JdbcType.TIMESTAMP)
    })
    List<WcClassStudent> selectByExample(WcClassStudentExample example);

    @Select({
        "select",
        "ID, STUDENT_ID, CLASS_ID, C_DATE",
        "from wc_class_student",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="STUDENT_ID", property="STUDENT_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="C_DATE", property="c_DATE", jdbcType=JdbcType.TIMESTAMP)
    })
    WcClassStudent selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcClassStudentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcClassStudent record, @Param("example") WcClassStudentExample example);

    @UpdateProvider(type=WcClassStudentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcClassStudent record, @Param("example") WcClassStudentExample example);

    @UpdateProvider(type=WcClassStudentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcClassStudent record);

    @Update({
        "update wc_class_student",
        "set STUDENT_ID = #{STUDENT_ID,jdbcType=BIGINT},",
          "CLASS_ID = #{CLASS_ID,jdbcType=BIGINT},",
          "C_DATE = #{c_DATE,jdbcType=TIMESTAMP}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcClassStudent record);
}